﻿using System;

namespace TravelPriceDemo
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入成人数量：");
            int adultCount = Convert.ToInt32(Console.ReadLine());
            Console.WriteLine("请输入儿童数量：");
            int childCount = Convert.ToInt32(Console.ReadLine());
            // 调用计算旅游价格的方法并输出结果
            Console.WriteLine($"旅游总价格为：{CalculateTravelPrice(adultCount, childCount)} 元");
            Console.ReadKey();
        }
        // 计算旅游价格的方法
        static double CalculateTravelPrice(int adultCount, int childCount)
        {
            const double adultPrice = 100;
            double childPrice = adultPrice / 2;
            int totalCount = adultCount + childCount;
            // 根据不同情况计算价格
            if (totalCount >= 10)
            {
                return adultCount * adultPrice * 0.8 + childCount * childPrice;
            }
            else
            {
                return adultCount * adultPrice + childCount * childPrice;
            }
        }
    }
}